#ifndef _XMLPARSER_HPP
#define _XMLPARSER_HPP
#include <string>
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
using std::string;



namespace com_oocl_riley
{
#define CAST_TO_XMLCHAR (const xmlChar *)
#define CAST_TO_CHAR (const char *)
class XmlParser
{
public:
    virtual ~XmlParser() {}

    void parseXml();
    virtual void *getContent()=0;
    string XmlFile() const
    {
        return _fileName;
    }
    void XmlFile(const string& fileName)
    {
        _fileName=fileName;
    }
    virtual void printAllContent()=0;
protected:
    explicit XmlParser(const string& fileName);
private:
    virtual void tranverse(xmlDocPtr doc,xmlNodePtr cur)=0;
private:
    string _fileName;
};


}

#endif // _XMLPARSER_HPP
